<template>
  <div class="left">
    <div>左</div>
    <div>
      父组件利用ref绑定子组件函数传递的值:inputOne=={{ inputOne }},valueTime== {{ valueTime }}
    </div>
    <div>---------------------------------------------------------</div>
    <h3>
      利用公交中线BUS接收给兄弟组件参数
    </h3>
    <div>
      info:{{ info }}
    </div>
  </div>
</template>

<script>
import Bus from "@/untils/bus";
export default {
  data() {
    return {
      inputOne: "",
      valueTime: [],
      info: {}
    }
  },
  //移除
  beforeDestroy() {
    Bus.$off('setListInfo');
  },
  watch: {},
  activated() { },
  created() {
    // 获取兄弟组件传来的值
    Bus.$on("setListInfo", (info) => {
      console.log("info", info);
      this.info = info
    })
  },
  methods: {
    init(inputOne, valueTime) {
      this.inputOne = inputOne;
      this.valueTime = valueTime;
      console.log('父组件利用ref调用子组件函数获取参数,然后调取接口', inputOne, valueTime);
    }
  },
  mounted() { }
}
</script>

<style lang='scss' scoped>
.left {
  /* width: 500px; */
  height: 100%;
  // min-width: 500px;
  // max-width: 800px;
  width: 100%;
  border: none !important;
}
</style>